<include file="public:header" />
<div class="pad-10" >
	<include file="public:search" />
    <form id="myform" name="myform" action="{:u(MODULE_NAME.'/delete')}" method="post" onsubmit="return check();">
    <div class="table-list">
    <table width="100%" cellspacing="0">
        <thead>
            <tr>
            	<th width="50">ID</th>
                <th width=15><input type="checkbox" value="" id="check_box" onclick="selectall('id[]');"></th>                              
                <th>{:L('title')}</th>
                <th>{:L('cate_title')}</th>
				<th>{:L('user')}</th>
                <th width=120>{:L('last_time')}</th>
                <th width="30">{:L('sort')}</th>
                <th width=30>{:L('recommend')}</th>
                <th width=30>{:L('status')}</th>
            </tr>
        </thead>
    	<tbody>
        <volist name="list" id="val" >
        <tr>
        	<td align="center">{$val.id}</td>
            <td align="center"><input type="checkbox" value="{$val.id}" name="id[]"></td>            
           	<td align="center"><em class="blue">{$val.title}</em></td>
            <td align="center">{$val.cate.title}</td>
           	<td  align="center">
           		<a href="{:u('user/index',array('keyword'=>$val['user']['name']))}" target="_blank">{$val.user.name}</a>
         	</td>
		   <td align="center">{:date("Y-n-j   H:i:s",$val["add_time"])}</td>
           <td>
           <input type="text" class="input-text-c input-text" value="{$val.sort_order}" size="4" name="listorders[{$val.id}]"  id="sort_{$val.id}" onblur="sort({$val.id},'sort_order',this.value)" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')">
           </td>
           <td align="center" onclick="status({$val.id},'recommend')" id="recommend_{$val.id}">
           		<img src="__ROOT__/statics/images/status_{$val.recommend}.gif" />
         	</td>           
           <td align="center" onclick="status({$val.id},'status')" id="status_{$val.id}">
           		<img src="__ROOT__/statics/images/status_{$val.status}.gif" />
         	</td>
        </volist>
    	</tbody>
    </table>
    <div class="btn">
    	<label for="check_box" style="float:left;">全选/取消</label>
    	<input type="submit" class="button" name="dosubmit" value="{$Think.lang.delete}" onclick="return confirm('{$Think.lang.sure_delete}')" style="float:left;margin:0 10px 0 10px;"/>
        
    	<div id="pages">{$page}</div>
    </div>
    </div>
    </form>
</div>
<script>
function sort(id,type,num){
    
    $.get("{:u('album/sort')}", { id: id, type: type,num:num }, function(jsondata){
        
		$("#"+type+"_"+id+" ").attr('value', jsondata.data);
	},'json'); 
}
</script>
<include file="public:footer" />